<template>
	<view class="content">

		<web-view ref="webview" fullscreen="false" :webview-styles="{progress:'#51d0d0'}" class="uni-flex-item"
			:src="config.path" @message="message">
		</web-view>
	</view>
</template>

<script setup lang="ts">
	import { ref, reactive, onMounted, computed } from 'vue'
	import { onLoad, onShow } from '@dcloudio/uni-app'
	import { useMainStore, useUserStore, useInventoryStore } from '@/store';

	const mainStore = useMainStore();
	const userStore = useUserStore();
	const inventoryStore = useInventoryStore();

	const menu = inventoryStore.Menu;


	let config = reactive({
		navTitle: '',
		path: ''
	});

	config.navTitle = menu.APFunName;
	// 拼接对应报表地址
	let path = mainStore.appConfigInfo.IPAgreement + mainStore.appConfigInfo.serverIP + '/ReportList/APPTable?moduleName=' + menu.Para + '&win_size=win_medium';

	config.path = path;

	// 接收从内部发出的信息
	const message = (event : any) => {

		console.log('接收到消息', event);


	}


	onShow(() => {
		console.log(config.navTitle);
		uni.setNavigationBarTitle({
			title: config.navTitle
		})
	})
</script>

<style scoped lang="scss">
	::v-deep {
		.uni-card {
			margin: 8px !important;
			padding: 0 !important;

			.uni-card__content {
				padding: 0 !important;
			}
		}
	}

	.content {
		// background-color: #51d0d0;
		display: flex;
		flex-direction: column;
		// align-items: center;
		// justify-content: center;
		/* 给顶部盒子安全高度 */
		// padding-top: var(--status-bar-height);

		.head {
			z-index: 99999999;
			position: relative;
		}

		.popup-container {
			z-index: 1001;
			/* 设置一个较高的z-index值 */
		}
	}

	.reportWrap {
		display: flex;
		flex-direction: column;
	}

	// 选择弹窗
	.picker-opt {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 5px 10px;
		border-bottom: 1px solid #f2f2f2;
		font-size: 16px;
		height: 40px;
	}

	.picker-opt>text:first-child {
		color: #999999;
	}

	.picker-opt>text:last-child {
		color: #51d0d0;
	}

	.picker-view {
		width: 750rpx;
		height: 400rpx;
		margin-top: 20rpx;
	}

	.item {
		line-height: 40px;
		text-align: center;
	}

	// 搜索弹窗
	.popSearch {
		display: flex;
		flex-direction: column;
		padding: 10px;
		font-size: 14px;
		background-color: #fff;

		.searchRow {
			display: flex;
			align-items: center;
			padding: 5px;
			margin-bottom: 5px;

			.rowRequire {
				display: flex;
				justify-content: center;
				align-items: center;
				width: 8px;
				height: 8px;
				margin-right: 5px;

				text {
					color: red;
				}
			}

			.rowLabel {
				width: 72px;
				margin-right: 5px;
				color: #3a3a3a;
			}

			.rowValue {
				flex: 1;
				color: #999999;
			}

			.uni-icons {
				color: #999999 !important;
			}
		}

		button {
			background-color: #51d0d0;
			display: block;
			border-radius: 0;
		}
	}
</style>